package com.lijian.service.impl;

import com.lijian.base.Result;
import com.lijian.mapper.RoleUserMapper;
import com.lijian.model.SysRoleUser;
import com.lijian.service.RoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleUserServiceImpl implements RoleUserService {

    @Autowired
    private RoleUserMapper roleUserMapper;

    @Override
    public Result<SysRoleUser> findRoleUserByUserId(Integer userId) {
        SysRoleUser sysRoleUser = roleUserMapper.findRoleUserByUserId(userId);
        if(sysRoleUser != null){
            return Result.success(sysRoleUser);
        }
        return Result.error();
    }
}
